﻿<%@ Page Language="C#" MasterPageFile="~/Default.master" AutoEventWireup="true" CodeFile="Cities.aspx.cs" Inherits="Cities" Title="Untitled Page" %>

<asp:Content ID="Header1" ContentPlaceHolderID="headerPlaceHolder" runat="server">

<script language="javascript" type="text/javascript">
    function doSomething() {
        var myElement = document.getElementById("myid");
        myElement.innerHTML = "....Accessing...";
        TopCitiesService.GetTopCities(setCities);
        
    }
    function setCities (city) {
        var myElement = document.getElementById("myid");
        myElement.innerHTML = city;
    }
</script>


</asp:Content>

<asp:Content ID="Content1" ContentPlaceHolderID="Main" Runat="Server">
    
    <asp:ScriptManager runat="server" ID="sm">
    <Services>
    <asp:ServiceReference Path="~/TopCitiesService.svc" />
    
    </Services>
    </asp:ScriptManager>
    <div class="shim column"></div>
    
    <div class="page" id="links">
        <div id="content">
            <div id="myid"><a href="javascript:doSomething()">Click here to best match launch event:</a></div>
            
            <p>Some cities for Visual Studio 2008 Launch</p>
            <p><asp:GridView ID="GridView1" runat="server"></asp:GridView></p>
            
            <p>Cities and the distance from Seattle (in Miles)
                <asp:GridView ID="GridView2" AutoGenerateColumns="false" runat="server">
                    <Columns>
                      <asp:BoundField HeaderText="Country" DataField="Country" />
                      <asp:BoundField HeaderText="City" DataField="City" />
                      <asp:BoundField HeaderText="Distance from Seattle" DataField="Distance" />
                    </Columns>
                </asp:GridView>
            </p>
            
            <p>Cities and their Distances
                <asp:GridView ID="GridView3" AutoGenerateColumns="false" runat="server">
                   <Columns>
                      <asp:BoundField HeaderText="Country" DataField="Country" />
                      <asp:BoundField HeaderText="City" DataField="City" />
                      <asp:BoundField HeaderText="Distance from Seattle" DataField="Distance" />
                   </Columns>
                </asp:GridView>
            </p>
            
            <p>Cities and their Distances - Skipping a few and taking some
                <asp:GridView ID="GridView4" AutoGenerateColumns="false" runat="server">
                   <Columns>
                      <asp:BoundField HeaderText="Country" DataField="Country" />
                      <asp:BoundField HeaderText="City" DataField="City" />
                      <asp:BoundField HeaderText="Distance from Seattle" DataField="Distance" />
                   </Columns>
                </asp:GridView>
            </p>
            
            <p><b>Farthest Distance City:</b>
                <asp:Label ID="MaxCityNameTxt" runat="server" Text="Label"></asp:Label>
                <asp:Label ID="MaxCityDistanceTxt" runat="server" Text="Label"></asp:Label><br />

                <b>Total Travel Distance (outside of US):</b>
                <asp:Label ID="TotalDistanceTxt" runat="server" Text="Label"></asp:Label><br />

                <b>Average Distance:</b>
                <asp:Label ID="AverageDistanceTxt" runat="server" Text="Label"></asp:Label><br />
            </p>
        </div>
    </div>
</asp:Content>

